using System;
using System.Collections.Generic;
using System.Text;

using DeviceManager.Device;
using DeviceManager.Common;
using LoggingClient;
using LittleATM.Interop.KXJournalPrinter;

namespace DeviceManager.Kal
{
    [Trace]
    public class KXJournalPrinterImpl : KXDeviceImpl
    {
        KXJournalPrinterClass journalPrinter = null;

        public override bool Init()
        {
            journalPrinter = new KXJournalPrinterClass();

            return true;
        }

        public override bool OpenConnection()
        {
            short ret = journalPrinter.OpenConnection();

            DMLogger.Instance.Info(string.Format("KXJournalPrinterImpl.OpenConnection() = {0}", ret));

            return true;
        }

        public override bool CloseConnection()
        {
            short ret = journalPrinter.CloseConnection();

            DMLogger.Instance.Info(string.Format("KXJournalPrinterImpl.CloseConnection() = {0}", ret));

            return true;
        }

        public void Print(string FormName, string FieldValues)
        {
            short ret = journalPrinter.Print(FormName, FieldValues);

            DMLogger.Instance.Info(string.Format("KXJournalPrinterImpl.OpenConnection() = {0}", ret));
        }
    }
}
